﻿using Spider.Ants.Workers;

namespace Spider.Ants
{
    /// <summary>
    /// 蚁后
    /// </summary>
    internal class AntQueen
    {
        private static AntQueen _antQueen;
        private static readonly  object _syncBoot=new object();
        private AntQueen()
        {
            
        }
        public static AntQueen GetInstance()
        {
            if (_antQueen == null)
            {
                lock (_syncBoot)
                {
                    if (_antQueen == null)
                    {
                        _antQueen = new AntQueen();
                    }
                }
            }
            return _antQueen;
        }
        /// <summary>
        /// 生产一个QQ空间蚂蚁
        /// </summary>
        /// <returns></returns>
        public  Spider.Ants.Ant CreateQqAnt()
        {
            return new QqAnt();
        }
        /// <summary>
        /// 生产一个QQ微博蚂蚁
        /// </summary>
        /// <returns></returns>
        public Spider.Ants.Ant CreateQqWbAnt()
        {
            return new QqWbAnt();
        }
        /// <summary>
        /// 生产一个Ygdy8net蚂蚁
        /// </summary>
        /// <returns></returns>
        public Spider.Ants.Ant CreateYgdy8netAnt()
        {
            return new Ygdy8netAnt();
        }
    }
}
